package com.ms.service.impl;

import com.ms.mapper.ResignApplyMapper;
import com.ms.pojo.Resign_apply;
import com.ms.service.ResignApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ResignApplyServiceImpl implements ResignApplyService {

    @Autowired
    private ResignApplyMapper resignApplyMapper;
    @Override
    public List<Resign_apply> getAllResignApplies() {
        return resignApplyMapper.selectAllResignApplies();
    }

    @Override
    public boolean agreeResignApply(Integer resignId) {
        if (resignId == null) {
            return false;
        }
        try {
            return resignApplyMapper.agreeResignApply(resignId) > 0;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }

    @Override
    public boolean rejectResignApply(Integer resignId) {
        if (resignId == null) {
            return false;
        }
        try {
            return resignApplyMapper.rejectResignApply(resignId) > 0;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
}
